import request from '@/utils/request'

// 查询设备列表
export function listDevice(query) {
  return request({
    url: '/geek/device/list',
    method: 'get',
    params: query
  })
}

// 查询设备详细
export function getDevice(deviceId) {
  return request({
    url: '/geek/device/' + deviceId,
    method: 'get'
  })
}

// 新增设备
export function addDevice(data) {
  return request({
    url: '/geek/device',
    method: 'post',
    data: data
  })
}

// 修改设备
export function updateDevice(data) {
  return request({
    url: '/geek/device',
    method: 'put',
    data: data
  })
}

// 删除设备
export function delDevice(deviceId) {
  return request({
    url: '/geek/device/' + deviceId,
    method: 'delete'
  })
}

// 导出设备
export function exportDevice(query) {
  return request({
    url: '/geek/device/export',
    method: 'get',
    params: query
  })
}

// 设备绑定检测方案
export function bindScheme(data) {
  return request({
    url: '/geek/device/bindScheme',
    method: 'post',
    data: data
  })
}

// 设备解绑检测方案
export function unbindScheme(data) {
  return request({
    url: '/geek/device/unbindScheme',
    method: 'post',
    data: data
  })
}

// 查询设备已绑定的检测方案
export function listDeviceSchemes(deviceId) {
  return request({
    url: '/geek/device/schemes/' + deviceId,
    method: 'get'
  })
}

// 设备注册码验证
export function verifyRegisterCode(data) {
  return request({
    url: '/geek/device/register/verify',
    method: 'post',
    data: data
  })
}

// 获取设备二维码
export function getDeviceQrcode(deviceId) {
  return request({
    url: '/geek/device/qrcode/' + deviceId,
    method: 'get'
  })
}
